import { listen } from '@feidao-factory/send-msg/browser/mqtt';
import { IFeidaoAiBrowserComponent } from '../../interfaces';

/**
 * 监听推送消息
 * @param fd 系统变量
 * @param topic 主题
 * @param event_no 事件编号
 */
export default function mqtt_listen(fd: IFeidaoAiBrowserComponent, topic: string, event_no: string) {
	const emit = fd.emit;
	listen(topic, (res) => {
		emit(event_no, res);
	});
}
